import {createAppContainer} from 'react-navigation'
import {createStackNavigator} from 'react-navigation-stack'
import React from 'react'
import {Button} from 'react-native'

import HomePage from '../Pages/HomePage'
import DetailPage from '../Pages/DetailPage'

const AppNavigator = createStackNavigator({
    HomePage: { //路由名
        screen: HomePage, //组件名
        navigationOptions: (props) => ({
            title: '首页啊'
        }) //props中就有navigation
    },
    DetailPage: {
        screen: DetailPage,
        navigationOptions: {
            title: '详情',
            // headerLeft: null,
            headerRight: <Button title="自定义"></Button>
        }
    }
}, {
    initialRouteName: 'HomePage',
    defaultNavigationOptions: {
        headerStyle: {
            backgroundColor: 'pink'
        }
    }
})


export default createAppContainer(AppNavigator)